<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<rich:panel header="#{messages['member.agreement.invoice.list']}">
	<h:panelGrid ><h:outputText value="#{errorBean.errorMessage}" styleClass="error"></h:outputText></h:panelGrid>
	
	<t:panelGrid columns="2">
		<h:outputText value="#{messages['agreement.no']}" styleClass="standardText_Label" />
		<h:outputText value="#{agentMemberAgreementInvoiceBean.agreement.agreetmentNo}" styleClass="standardText" />
		
		<h:outputText value="#{messages['membership']}" styleClass="standardText_Label" />
		<h:outputText value="#{agentMemberAgreementInvoiceBean.agreement.membership.name}" styleClass="standardText" />
	</t:panelGrid>
	
	<rich:spacer height="30" />
	
	<rich:dataTable id="data" var="invoice" value="#{agentMemberAgreementInvoiceBean.invoiceList}" rows="20" width="99%" >
		<rich:column style="text-align:center;width:15%;" >
			<f:facet name="header">
				<h:outputText value="#{messages['invoice.no']}"></h:outputText>
			</f:facet>
			<h:outputText value="#{invoice.invoiceNo}"></h:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:20%;">
			<f:facet name="header">
				<h:outputText value="#{messages['desc']}"></h:outputText>
			</f:facet>
			<h:outputText value="#{invoice.invoiceDtl.itemDesc}"></h:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:15%;">
			<f:facet name="header">
				<h:outputText value="#{messages['amount']}"></h:outputText>
			</f:facet>
			<h:outputText value="#{invoice.invoiceAmount}"></h:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:15%;">
			<f:facet name="header">
				<h:outputText value="#{messages['invoide.date']}"></h:outputText>
			</f:facet>
			<h:outputText value="#{invoice.invoiceDate}"></h:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:10%;">
			<f:facet name="header">
				<h:outputText value="#{messages['status']}"></h:outputText>
			</f:facet>
			<h:outputText value="#{invoice.invoiceDtl.status}"></h:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:15%;">
			<f:facet name="header">
				<h:outputText value="#{messages['pay']}"></h:outputText>
			</f:facet>
			<h:commandButton value="#{messages['action']}" styleClass="button" action="#{agentMemberAgreementInvoiceBean.memberPaymentNavigate}" 
			actionListener="#{agentMemberAgreementInvoiceBean.memberPaymentListener}" 
			rendered="#{agentMemberAgreementInvoiceBean.flag == invoice.invoiceDtl.status}"></h:commandButton>
			<h:outputText rendered="#{agentMemberAgreementInvoiceBean.flag != invoice.invoiceDtl.status}"></h:outputText>
			<f:param value="#{invoice.invoiceId}" id="invoiceId" />
		</rich:column>
	</rich:dataTable>
	
	<rich:spacer height="30" />
	
	<rich:datascroller align="left"  for="data" maxPages="20" />

	<rich:spacer height="30" />
	<t:panelGrid columns="1">
		<h:commandButton value="#{messages['back']}" styleClass="button" action="#{agentBean.navPortalAction}" immediate="true"></h:commandButton>
	</t:panelGrid>

            
</rich:panel>
